package com.caregiver.watch.business.data.controller;

import com.caregiver.watch.business.data.service.DeviceDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * this api is for watch uploading alarm data
 * content-type : application/octet-stream
 */
@RestController
@RequestMapping("/alarm")
@Slf4j
public class AlarmController {

    @Autowired
    private DeviceDataService deviceService;

    @RequestMapping(value = "upload", method = RequestMethod.POST)
    private void uploadAlarmData(HttpServletRequest req, HttpServletResponse resp) {
        deviceService.uploadAlarmData(req, resp);
    }

}
